package com.itheima.test4lambdadaicanwufan;

import java.sql.SQLOutput;

public class Demo5 {
    public static void main(String[] args) {
        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(String msg) {
                System.out.println("我是匿名的"+msg);
            }
        });
        System.out.println("----------------------");
        useStringHandler( msg-> System.out.println("我是Lambda的"+msg));
    }
    public static void useStringHandler(StringHandler stringHandler){
        stringHandler.printMessage("常山赵子龙");
    }
}
interface StringHandler{
    void printMessage(String msg);
}